home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / forthcmp.zip / FARMEM2.4TH < prev    next >
Text File  |  1992-03-30  |  1KB  |  35 lines

  1. \ Far Memory management functions
  2.  
  3. \ Code Copyright (C) 1991 by Thomas Almy. All rights reserved.
  4. \ Permission is granted to registered users of ForthCMP to sell or distribute
  5. \ computer programs incorporating the compiled contents of this file.
  6.  
  7. \ Load farmem1.4th at the start of your program
  8. \ Load load this file at the end of your program before FORTHLIB
  9.  
  10.  
  11. 10 HEX
  12. UNDEF malloc CODE malloc
  13.      AX BX MOV  48 # AH MOV 21 INT
  14.      <U ~ IF, AX BX MOV AX AX XOR THEN, RET END-CODE #THEN
  15. UNDEF FREE CODE FREE
  16.      AX ES >SEG 49 # AH MOV 21 INT RET END-CODE #THEN
  17. UNDEF realloc CODE realloc 
  18.      BX ES >SEG AX BX MOV 4A # AH MOV 21 INT
  19.      <U IF, -1 # AX MOV ELSE, AX AX XOR THEN, RET END-CODE #THEN
  20. UNDEF salloc CODE salloc
  21.      SI POP AX AX ADD AX SP SUB  SP AX MOV  SI JMPI  END-CODE #THEN
  22. UNDEF sfree CODE sfree
  23.      SI POP AX AX ADD AX SP ADD SI JMPI END-CODE #THEN
  24. UNDEF D>L CODE D>L
  25.      BX DX MOV
  26.      AX 1 ROR DX 1 ROR   AX 1 ROR DX 1 ROR
  27.      AX 1 ROR DX 1 ROR   AX 1 ROR DX 1 ROR
  28.      BX AX MOV 0F # AX AND DX BX MOV RET END-CODE #THEN
  29. UNDEF L>D CODE L>D
  30.      DX DX XOR
  31.      BX 1 ROL DX 1 ROL  BX 1 ROL DX 1 ROL
  32.      BX 1 ROL DX 1 ROL  BX 1 ROL DX 1 ROL
  33.      DX AX ADD 0 # BX ADC  AX BX XCHG RET END-CODE #THEN
  34. 0A = #IF DECIMAL #THEN
  35.